<?php include $this->getViewFile('/common/Head'); ?>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
   <?php include $this->getViewFile('/common/Nav') ?>
   <form class="J_ajaxForm" action="<?php echo AdminBase::U("edit") ?>" method="post" id="myform">
   <input type="hidden" name="id" value="<?php echo $data->id ?>"/>
   <div class="h_a">基本属性</div>
   <div class="table_full">
   <table width="100%" class="table_form contentWrap">
        <tbody>
          <tr>
            <th width="80">所属栏目</th>
            <td><select name="catid">
                   <?php  echo ContentCategoryModel::model()->htmlCategorySelectOption($data['catid']); ?>
                </select> <em>请先选择栏目</em></td>
          </tr>
          <tr>
            <th>标题</th>
            <td><input type="test" name="title" class="input length_6" id="title" value="<?php echo $data['title']?>"></td>
          </tr>
          <tr>
            <th>关键字</th>
            <td><input type="text" name="keywords" class="input length_4" id="keywords" value="<?php echo $data['keywords']?>"></td>
          </tr>
          <tr>
            <th>简介</th>
            <td><textarea name="description" class="length_6"><?php echo $data['description']?></textarea></td>
          </tr>
          <tr>
            <th>类型</th>
            <td><?php echo Form::select(array(0=>'编辑器内容模式',1=>'HTML代码模式'),$data['ishtml'],'id="ishtml" name="ishtml"onchange="incident(this)" ') ?></td>
          </tr> 
          <?php if($data['ishtml']==0):?>
          <tr id="edit" >
            <th>内容</th>
            <td>
                        <script type="text/plain" id="content" name="content"><?php echo $data['content']?></script>
            <?php 
			echo Form::editor('content','full',1,1,'',10,300,1);
			?>
            </td>
          </tr>
          <?php else: ?>
          <tr id="htmlmod">
              <th> 内容</th>
              <td>                 
                  <textarea name="content" style="min-width:800px;min-height: 600px;font-size: 14px;"><?php if($data['ishtml']==1){echo $data['content'];}?></textarea>
              </td>
          </tr>
          <?php endif ?>
        </tbody>
      </table>
   </div>
   <div class="btn_wrap" style="z-index:30">
      <div class="btn_wrap_pd">             
        <input type="hidden" name="id" value="<?php echo $data['id']?>">
        <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">修改</button>
      </div>
    </div>
    </form>
</div>
<script src="<?php echo $staticUrl; ?>statics/js/common.js"></script>
</body>
<script type="text/javascript">
     function   incident(x){
         var html = x.value;       
         if (html === '1') {
            $(" #edit").hide();
            $(' #htmlmod').show();
        }
        else {
            $(' #htmlmod').hide();
            $(' #edit').show();
        }
    }
</script>
</html>